package org.seed.rpc.core;


import org.seed.rpc.core.routing.RandomStrategy;
import org.seed.rpc.core.routing.RoutingStrategy;
import org.springframework.stereotype.Component;

import java.lang.annotation.*;


/**
 * 使用在「RPC接口」或「服务的实现类」
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
@Component
public @interface RpcService {

    /**
     * 服务名
     */
    String serviceName();


    /**
     * 路由规则
     */
    Class<? extends RoutingStrategy> routingStrategy() default RandomStrategy.class;

    /**
     * 请求超时时间
     */
    long requestTimeout() default 8000L;

}
